package com.sec.android.app.myfiles.widget.listview.pinchview;

import android.view.View;

/**
 * Created by jaebae on 2016-05-21.
 */
public class GridViewItemInfo {
    View mView;
    int mPosition;
    int mRow;
    int mCol;
    int mColSize;

    GridViewItemInfo(View view, int position, int colSize) {
        init(view, position, colSize);
    }

    GridViewItemInfo(int position, int colSize) {
        init(null, position, colSize);
    }

    void init(View view, int position, int colSize) {
        mView = view;
        mRow = position / colSize;
        mCol = position % colSize;
        mPosition = position;
        mColSize = colSize;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(mPosition).append(" - ").append(mView.getVisibility());
        sb.append(" [").append(mRow).append(',').append(mCol).append("] ");
        sb.append('(').append(mView.getX()).append(',').append(mView.getY()).append(',').append(mView.getLeft()).append(',').append(mView.getBottom()).append(") ");
        sb.append('(').append(mView.getWidth()).append('x').append(mView.getHeight()).append(')');
        sb.append(mView.hashCode());
        return sb.toString();
    }
}
